package cn.webrx;

import java.util.InputMismatchException;
import java.util.Scanner;

public class Ex2 {
    public static void main(String[] args) {
        try{
            Scanner sc = new Scanner(System.in);
            System.out.println("请输入整数a:");
            int a = sc.nextInt();
            if(a==6){
                String n = null;
                System.out.println(n.length());
            }
            System.out.println("请输入整数b:");
            int b = sc.nextInt();
            System.out.printf("%d / %d = %d", a, b, a / b);
        }catch(ArithmeticException e){
            System.out.println("b数不能输入0");
        }catch(InputMismatchException e){
            System.out.println("请输入整数");
        }catch(Exception e){
            System.out.println("程序未知异常错误");
        }finally{
            System.out.println("程序结束");
        }
    }
}
